package de.hmm.hwip.connection.api;

import java.net.Socket;

import org.json.JSONObject;
import org.osgi.framework.BundleContext;

import android.content.Context;

/**
 *	Interface for outgoing network service
 * 
 * @author johannes mendel
 * @version 10.10.2012
 *	
 */
public interface IConOut {
	/**
	 * starts a new Connection to send the data to other devices
	 * @param connection: Socket-Input received from other devices
	 * @param context: BundleContext from OSGi
	 * @param data: JSONObject with data
	 * @param securityFlag: boolean if connection is crypted
	 */
	public void startCon(Socket connection, BundleContext context, JSONObject data,boolean securityFlag);
	
	/**
	 * starts a new Connection to send the data to other devices
	 * @param receiver: receiver of data
	 * @param context: BundleContext from OSGi
	 * @param data: JsonObject with data
	 * @param securityFlag: boolean if connection is crypted
	 */
	public void startCon(String receiver, BundleContext context, Context androidContex, JSONObject data, boolean securityFlag);
	
	/**
	 * starts a new Connection with every receiver in targets field and sends given data
	 * @param targets: Receivers of data
	 * @param context: BundleContext from OSGi
	 * @param data: Information to send
	 * @param securityFlag: boolean if connection is crypted
	 */
	public void startBurstCon(String[] targets, BundleContext context, JSONObject data, boolean securityFlag);

}
